package set;

public class HashSetTest {
    public static void main(String[] args) {
        Car c1 = new Car("bmw",10000);
        Car c2 = new Car("bmw",10000);
        //不同对象的哈希值不一样
        System.out.println(c1.hashCode());
        System.out.println(c2.hashCode());
        //重写hashCode后属性相同则哈希值相同
        // 不同对象hashCode也可能一样 -> 哈希碰撞
        System.out.println("abc".hashCode());
        System.out.println("acD".hashCode());

    }
}
